﻿@model IFrontEndViewModelBase
@{
    // get type data
    var typeData = Model.GetTypeData();
    
    // get is edit
    var isEdit = (bool)ViewBag.IsEdit;

    // set title
    ViewBag.Title =
        isEdit ?
        "Edit " + Model.Node.Name :
        "Create new " + typeData.FriendlyName;
}
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm())
{
    @:@Html.ValidationSummary(false)
    <div class="proggy-hidden" style="display: none;">
        @Html.EditorFor(m => m.Node)
    </div>    
    foreach (var tab in typeData.Tabs)
    { 
    <h3>@tab.Name</h3>
        foreach (var propt in tab.PropertyTypes)
        { 
    <h4>@propt.FriendlyName</h4>
    
            Html.RenderProggyEditorForFrontEndViewModelPropertyType(propt);

        }
    }
    
    <p>
        <input type="submit" value="Submit" /></p>
}
